package com.cloudknow.utils;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.cloudknow.common.R;


/**
 * Create bu wubin on .
 *
 * @description
 */
public class ConstomDialog extends Dialog {

    /**取消按钮*/
    private Button  un_keep;

    /**确认按钮*/
    private Button keep;

    /**标题文字*/
    private TextView tv;


    //构造方法
    public ConstomDialog(Context context) {
        super(context, R.style.CustomDialog);
        //通过LayoutInflater获取布局
        View view = LayoutInflater.from(getContext()).
                inflate(R.layout.refused_hint_view, null);

        tv = (TextView) view.findViewById(R.id.title);
         un_keep = (Button) view.findViewById(R.id.un_keep);
        keep = (Button) view.findViewById(R.id.keep);

        //设置显示的视图
        setContentView(view);
    }

    /**
     * 设置显示的标题文字
     */
    public void setTv(String content) {
        tv.setText(content);
    }
    public void setUnKkeep(String content) {
        un_keep.setText(content);
    }
    public void setKkeep(String content) {
        keep.setText(content);
    }

    /**
     * 取消按钮监听
     * */
    public void setOnCancelListener(View.OnClickListener listener){
         un_keep.setOnClickListener(listener);
    }

    /**
     * 退出按钮监听
     * */
    public void setOnExitListener(View.OnClickListener listener){
        keep.setOnClickListener(listener);
    }
}
